<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>

</head>

<body>
    <!-- ========================== Vue 条件 ========================== -->
    <div id="app-if">
        <p>flag:{{flag}}</p>
        <p v-if="flag">现在你能看见这行字了</p>
    </div>

    <script>
        new Vue({
            el: '#app-if',
            data: {
                flag: false,
            }
        })
    </script>

    <!-- ========================== Vue 循环 ========================== -->
    <div id="app-for">
        <ol>
            <li v-for="todo in todos">
                {{todo.text}}
            </li>
        </ol>
    </div>

    <script>
        new Vue({
            el: '#app-for',
            data: {
                todos: [
                    { text: "学习 html" }, 
                    { text: "学习 css" }, 
                    { text: "学习Vue" }
                ]
            }
        })
    </script>
</body>

</html>